package com.gitee.cnlongs.cnlongmq.basic.exception;

import com.gitee.cnlongs.cnlongmq.basic.entitiy.request.CnLongMessageQueue;
import com.gitee.cnlongs.cnlongmq.basic.enums.exception.CnLongMqExceptionEnums;

/**
 * 系统名称：CnLongMqBaseException
 * 模块名称：
 * 模块描述：异常基类
 * 功能列表：
 * 模块作者：zouyong
 * 开发时间：2019年7月25日 下午7:40:42
 * 模块路径：com.gitee.cnlongs.cnlongmq.basic.exception.CnLongMqBaseException
 */
public class CnLongMqBaseException extends RuntimeException {
	
	// 序列化ID
	private static final long serialVersionUID = 1L;

	// 错误编码
	private String errorCode;
	
	// 错误描述
	private String errorMsg;
	
	// 异常枚举
	private CnLongMqExceptionEnums expNums;
	
	// 队列信息
	private CnLongMessageQueue sequence;
	
	public CnLongMqBaseException(CnLongMqExceptionEnums expNums) {
		super(expNums.getMsg());
		this.expNums = expNums;
		this.errorCode = expNums.getCode();
		this.errorMsg = expNums.getMsg();
	}
	
	public CnLongMqBaseException(CnLongMqExceptionEnums expNums, CnLongMessageQueue sequence) {
		super(expNums.getMsg());
		this.expNums = expNums;
		this.errorCode = expNums.getCode();
		this.errorMsg = expNums.getMsg();
		this.sequence = sequence;
	}
	
	public CnLongMqBaseException(String errorCode, String errorMsg) {
		super(errorMsg);
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}
	
	public CnLongMqBaseException(String errorCode, String errorMsg, Throwable throwable) {
		super(errorMsg, throwable);
		this.errorCode = errorCode;
		this.errorMsg = errorMsg;
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public CnLongMqExceptionEnums getExpNums() {
		return expNums;
	}

	public void setExpNums(CnLongMqExceptionEnums expNums) {
		this.expNums = expNums;
	}

	public CnLongMessageQueue getSequence() {
		return sequence;
	}

	public void setSequence(CnLongMessageQueue sequence) {
		this.sequence = sequence;
	}
	
}
